package com.dameng.work.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dameng.work.mapper.BRANDMapper;
import com.dameng.work.mapper.SHELLMapper;
import com.dameng.work.pojo.BRAND;
import com.dameng.work.pojo.SHELL;
import com.dameng.work.service.BRANDService;
import com.dameng.work.service.SHELLService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;


@Service
public class BRANDServiceImpl implements BRANDService {


    @Autowired
    private BRANDMapper bRANDMapper;


    @Override
    public List<BRAND> findAllList() {
        List<BRAND> tabnums = bRANDMapper.selectList(new QueryWrapper<>());
        return tabnums;
    }

    @Override
    public BRAND findRandomBRAND() throws IOException {
        int i = RandomUtil.randomInt(1, 4);
        return bRANDMapper.selectById(i);
    }
}
